<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<jsp:include page="Header.jsp"/>
<title>Approval Page</title>
</head>
<body>

<jsp:include page="AdminNav.jsp"/>
<script >
$(document).ready(function() {
	oTable = $('#example').dataTable({
		"bJQueryUI": true,
		"sPaginationType": "full_numbers"
	});
} );

</script>
	<h2>Leave Approval Page</h2>
	<div class= "col-md-10 panel panel-success">
	<table id="example"  style="text-align: center;" border="1px" cellpadding="0"
		cellspacing="0">
		<thead>
			<tr>
				<td>App Date</td>
				<td>Emp Name</td>
				<td>Start Date</td>
				<td>End Date</td>
				<td>Leave Type</td>
				<td>Reason</td>
				<td>Approval Status</td>
				<td>App Status</td>
				<td>Action</td>
		</thead>
		<tbody>
			<c:forEach var="leaveDetail" items="${leaveDetailList}">
				<tr>
					<td>${leaveDetail.applicationDate}</td>
					<td>${leaveDetail.employeeId.name}</td>
					<td>${leaveDetail.startDate}</td>
					<td>${leaveDetail.endDate}</td>
					<td>${leaveDetail.leaveType.name}</td>
					<td>${leaveDetail.reason}</td>
					<td>${leaveDetail.approvalStatus}</td>
					<td>${leaveDetail.status}</td>

					<td><a
						href="${pageContext.request.contextPath}/LeaveDetail/edit-emp/${leaveDetail.leaveDetailId}.html">Approve /</a>
						<a
						href="${pageContext.request.contextPath}/LeaveDetail/edit-emp/reject/${leaveDetail.leaveDetailId}.html">Reject /</a>
						<a
						href="${pageContext.request.contextPath}/LeaveDetail/edit-emp/view/${leaveDetail.leaveDetailId}.html">Details</a>
					</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	</div>
	
<jsp:include page="footer.jsp"/>
</body>
</html>